<?php
class ImpSoft_View_Helper_FormError extends Zend_View_Helper_FormElement {

    public function formError($key, $errors = array(), $template = null) {
    
		$return = "";
		if (is_null($template)) {
			$template = "<p class=\"error\">%s</p>";
		}
        if (isset($errors[$key])) {
            if (is_array($errors[$key])) {
				foreach ($errors[$key] as $error) {
					$return .= sprintf($template, $error);
				}
			} else {
				$return .= sprintf($template, $errors[$key]);
			}
        }	
		return $return;
    
    }

}